﻿Imports System.Text.RegularExpressions
Imports System.IO
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Imports System.Threading

Public Enum UserLevel
    Utilisateur = 0
    Moderateur = 1
    Administrateur = 2
End Enum

Public Enum Sexe
    Femme = 0
    Homme = 1
    Inconnu = 2
End Enum

Public Structure UtilisateurPreco
    Private m_UserLevel As UserLevel
    Private m_Sexe As Sexe
    Private m_Compte As String
    Private m_Pseudo As String
    Private m_Age As Integer
    Private m_Ville As String
    Private m_Domain As Integer

    Public ReadOnly Property UserLevel As UserLevel
        Get
            Return m_UserLevel
        End Get
    End Property

    Public ReadOnly Property Sexe As Sexe
        Get
            Return m_Sexe
        End Get
    End Property

    Public ReadOnly Property Compte As String
        Get
            Return m_Compte
        End Get
    End Property

    Public ReadOnly Property Pseudo As String
        Get
            Return m_Pseudo
        End Get
    End Property

    Public ReadOnly Property Age As Integer
        Get
            Return m_Age
        End Get
    End Property

    Public ReadOnly Property Ville As String
        Get
            Return m_Ville
        End Get
    End Property

    Public ReadOnly Property Domain As Integer
        Get
            Return m_Domain
        End Get
    End Property

    Public Sub New(compte As String, pseudo As String, userLevel As UserLevel, age As Integer, sexe As Sexe, ville As String, domain As Integer)
        If Not userLevel = JuneLiveServer.UserLevel.Utilisateur Then
            age = -1
            sexe = JuneLiveServer.Sexe.Inconnu
            ville = "Junemods"
        ElseIf ville = "Junemods" Then
            ville = "?"
        End If

        With Me
            .m_Compte = compte
            .m_Pseudo = pseudo
            .m_UserLevel = userLevel
            .m_Age = age
            .m_Sexe = sexe
            .m_Ville = If(String.IsNullOrEmpty(ville), "?", ville)
            .m_Domain = domain
        End With
    End Sub
End Structure
